﻿using System;

namespace PoolKit.Commands
{
    internal class ActionCommand : Command
    {
        private readonly Action _commandAction;

        public ActionCommand(Action commandAction)
        {
            if (commandAction == null) throw new ArgumentNullException("commandAction");

            _commandAction = commandAction;
        }

        public override void Execute()
        {
            _commandAction.Invoke();
        }
    }
}